# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Tom Richards <tom@tomrichards.net>
# Contributor: TingPing <tingping@tingping.se>
# Contributor: Omar Pakker <omar.pakker@oracle.com>

pkgname=retro-gtk
pkgver=1.0.2
pkgrel=1
pkgdesc='Toolkit to write GTK+ 3 based Libretro frontends'
arch=('loong64' 'x86_64')
license=('GPL3')
url='https://wiki.gnome.org/Apps/Games'
depends=('libepoxy' 'glib2' 'gtk3' 'libpulse' 'libsamplerate')
makedepends=('gobject-introspection' 'meson' 'vala' 'git' 'gtk-doc')
provides=('libretro-gtk-1.so')
_commit=422b70aa9465ea65ea70edcc9a093368cac22b2a  # tags/1.0.2^0
source=("git+https://gitlab.gnome.org/GNOME/retro-gtk.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

build() {
  arch-meson $pkgname build \
    -D build-doc=true \
    -D install-doc=true
  meson compile -C build
}

check() {
  # Tests try to run the installed /usr/lib/retro-runner

  #dbus-run-session xvfb-run \
  #  -s '-screen 0 1920x1080x24 -nolisten local' \
  #  meson test -C build --print-errorlogs
  :
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}
